package jumpingnotes.model.entity;

// Generated Sep 6, 2008 9:47:30 AM by Hibernate Tools 3.2.1.GA

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Sync generated by hbm2java
 */
@Entity
@Table(name = "sync", catalog = "jumping_notes")
public class Sync implements java.io.Serializable
{

	private Integer syncId;
	private String uuid;
	private Date createTime;
	private Set<Audio> audios = new HashSet<Audio>(0);

	public Sync()
	{
	}

	public Sync(String uuid, Date createTime)
	{
		this.uuid = uuid;
		this.createTime = createTime;
	}

	public Sync(String uuid, Date createTime, Set<Audio> audios)
	{
		this.uuid = uuid;
		this.createTime = createTime;
		this.audios = audios;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "sync_id", unique = true, nullable = false)
	public Integer getSyncId()
	{
		return this.syncId;
	}

	public void setSyncId(Integer syncId)
	{
		this.syncId = syncId;
	}

	@Column(name = "uuid", nullable = false, length = 100)
	public String getUuid()
	{
		return this.uuid;
	}

	public void setUuid(String uuid)
	{
		this.uuid = uuid;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time", nullable = false, length = 19)
	public Date getCreateTime()
	{
		return this.createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "sync")
	public Set<Audio> getAudios()
	{
		return this.audios;
	}

	public void setAudios(Set<Audio> audios)
	{
		this.audios = audios;
	}

}
